<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
    *{margin:0;padding:0;}
    p{
        width:1200px;
    }
    div{
        overflow-x: scroll;
    }
    </style>
</head>
<body>
    <div id="test">
        <p>kd kaej aldjk jfkdj akdl aldjf alkdj ij lejk djgfi laekjf kdj alkdj eirj el jjlakfd ejhtl ladkjf lakdfjh aldk akdj alkde alkdj udyhgf rejh if jkdjh lakej udh laj </p>
    </div>
    <script>
    var test=document.getElementById("test");
    console.log(test.scrollWidth)
    </script>
</body>
</html>